package lol.clann.bukkit.pluginboot.constant.material;

import lol.clann.bukkit.pluginboot.util.ItemStackUtils;
import lol.clann.clannboot.context.BeanContext;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

/**
 * @author pyz
 * @date 2018/8/22 上午8:24
 */
public class Avaritia {

    public static final ImmutablePair<String, Integer> 阿卡西记录 = ImmutablePair.of("AVARITIA_AKASHIC_RECORD", 0);


    public static final ImmutablePair<String, Integer> Extremely_Primordial_Pearl = ImmutablePair.of("AVARITIA_BIG_PEARL", 0);


    public static final ImmutablePair<String, Integer> 寰宇肉丸 = ImmutablePair.of("AVARITIA_COSMIC_MEATBALLS", 0);


    public static final ImmutablePair<String, Integer> 水晶矩阵 = ImmutablePair.of("AVARITIA_CRYSTAL_MATRIX", 0);


    public static final ImmutablePair<String, Integer> 终极工作台 = ImmutablePair.of("AVARITIA_DIRE_CRAFTING", 0);


    public static final ImmutablePair<String, Integer> 压缩工作台 = ImmutablePair.of("AVARITIA_DOUBLE_CRAFT", 0);


    public static final ImmutablePair<String, Integer> 终望珍珠 = ImmutablePair.of("AVARITIA_ENDEST_PEARL", 0);


    public static final ImmutablePair<String, Integer> 无尽小土豆 = ImmutablePair.of("AVARITIA_INFINITATO", 0);


    public static final ImmutablePair<String, Integer> 自然荒芜之斧 = ImmutablePair.of("AVARITIA_INFINITY_AXE", 0);


    public static final ImmutablePair<String, Integer> 天堂陨落长弓 = ImmutablePair.of("AVARITIA_INFINITY_BOW", 0);


    public static final ImmutablePair<String, Integer> 无尽胸甲 = ImmutablePair.of("AVARITIA_INFINITY_CHEST", 0);


    public static final ImmutablePair<String, Integer> 无尽头盔 = ImmutablePair.of("AVARITIA_INFINITY_HELM", 0);


    public static final ImmutablePair<String, Integer> 无尽护腿 = ImmutablePair.of("AVARITIA_INFINITY_PANTS", 0);


    public static final ImmutablePair<String, Integer> 世界崩解之镐 = ImmutablePair.of("AVARITIA_INFINITY_PICKAXE", 0);


    public static final ImmutablePair<String, Integer> 无尽靴子 = ImmutablePair.of("AVARITIA_INFINITY_SHOES", 0);


    public static final ImmutablePair<String, Integer> 星球吞噬之铲 = ImmutablePair.of("AVARITIA_INFINITY_SHOVEL", 0);


    public static final ImmutablePair<String, Integer> 寰宇支配之剑 = ImmutablePair.of("AVARITIA_INFINITY_SWORD", 0);


    public static final ImmutablePair<String, Integer> 物质团 = ImmutablePair.of("AVARITIA_MATTER_CLUSTER", 0);


    public static final ImmutablePair<String, Integer> 中子态素收集器 = ImmutablePair.of("AVARITIA_NEUTRON_COLLECTOR", 0);


    public static final ImmutablePair<String, Integer> 中子态素压缩机 = ImmutablePair.of("AVARITIA_NEUTRONIUM_COMPRESSOR", 0);


    public static final ImmutablePair<String, Integer> 钻石晶格 = ImmutablePair.of("AVARITIA_RESOURCE", 0);
    public static final ImmutablePair<String, Integer> 水晶矩阵锭 = ImmutablePair.of("AVARITIA_RESOURCE", 1);
    public static final ImmutablePair<String, Integer> 中子素尘埃 = ImmutablePair.of("AVARITIA_RESOURCE", 2);
    public static final ImmutablePair<String, Integer> 中子素颗粒 = ImmutablePair.of("AVARITIA_RESOURCE", 3);
    public static final ImmutablePair<String, Integer> 中子锭 = ImmutablePair.of("AVARITIA_RESOURCE", 4);
    public static final ImmutablePair<String, Integer> 无尽催化剂 = ImmutablePair.of("AVARITIA_RESOURCE", 5);
    public static final ImmutablePair<String, Integer> 无尽之锭 = ImmutablePair.of("AVARITIA_RESOURCE", 6);
    public static final ImmutablePair<String, Integer> 唱片碎片 = ImmutablePair.of("AVARITIA_RESOURCE", 7);


    public static final ImmutablePair<String, Integer> 中子态素块 = ImmutablePair.of("AVARITIA_RESOURCE_BLOCK", 0);
    public static final ImmutablePair<String, Integer> 无尽之块 = ImmutablePair.of("AVARITIA_RESOURCE_BLOCK", 1);


    public static final ImmutablePair<String, Integer> 奇点_铁 = ImmutablePair.of("AVARITIA_SINGULARITY", 0);
    public static final ImmutablePair<String, Integer> 奇点_金 = ImmutablePair.of("AVARITIA_SINGULARITY", 1);
    public static final ImmutablePair<String, Integer> 奇点_青金石 = ImmutablePair.of("AVARITIA_SINGULARITY", 2);
    public static final ImmutablePair<String, Integer> 奇点_红石 = ImmutablePair.of("AVARITIA_SINGULARITY", 3);
    public static final ImmutablePair<String, Integer> 奇点_下界石英 = ImmutablePair.of("AVARITIA_SINGULARITY", 4);
    public static final ImmutablePair<String, Integer> 奇点_铜 = ImmutablePair.of("AVARITIA_SINGULARITY", 5);
    public static final ImmutablePair<String, Integer> 奇点_锡 = ImmutablePair.of("AVARITIA_SINGULARITY", 6);
    public static final ImmutablePair<String, Integer> 奇点_铅 = ImmutablePair.of("AVARITIA_SINGULARITY", 7);
    public static final ImmutablePair<String, Integer> 奇点_银 = ImmutablePair.of("AVARITIA_SINGULARITY", 8);
    public static final ImmutablePair<String, Integer> 奇点_镍 = ImmutablePair.of("AVARITIA_SINGULARITY", 9);


    public static final ImmutablePair<String, Integer> 炽焰之啄颅剑 = ImmutablePair.of("AVARITIA_SKULL_SWORD", 0);


    public static final ImmutablePair<String, Integer> 二重压缩工作台 = ImmutablePair.of("AVARITIA_TRIPLE_CRAFT", 0);


    public static final ImmutablePair<String, Integer> 超级煲 = ImmutablePair.of("AVARITIA_ULTIMATE_STEW", 0);

    private static ItemStackUtils itemStackUtils;

    private static ItemStackUtils getItemStackUtils() {
        if (itemStackUtils == null) {
            itemStackUtils = BeanContext.getBean(ItemStackUtils.class);
        }
        return itemStackUtils;
    }

    public static boolean hasWujin(Player p) {
        //判断是否穿着无尽套
        ItemStack equipment;
        //头盔
        equipment = p.getInventory().getHelmet();
        if (getItemStackUtils().isEmpty(equipment) || !equipment.getType().name().equals(Avaritia.无尽头盔.getLeft())) {
            return false;
        }
        //胸甲
        equipment = p.getInventory().getChestplate();
        if (getItemStackUtils().isEmpty(equipment) || !equipment.getType().name().equals(Avaritia.无尽胸甲.getLeft())) {
            return false;
        }
        //裤子
        equipment = p.getInventory().getLeggings();
        if (getItemStackUtils().isEmpty(equipment) || !equipment.getType().name().equals(Avaritia.无尽护腿.getLeft())) {
            return false;
        }
        //鞋子
        equipment = p.getInventory().getBoots();
        if (getItemStackUtils().isEmpty(equipment) || !equipment.getType().name().equals(Avaritia.无尽靴子.getLeft())) {
            return false;
        }
        return true;
    }
}


